/* SmartUI Studio - 主样式表 */

:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --light-color: #f8f9fa;
    --dark-color: #202124;
    --gray-color: #5f6368;
    --border-color: #dadce0;
    --hover-color: #e8f0fe;
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 2px 6px 2px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --header-height: 60px;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Noto Sans SC', sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow: hidden;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    padding: 0 16px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.menu-btn, .home-btn {
    display: flex;
    align-items: center;
    margin-right: 16px;
    border: none;
    background: none;
    cursor: pointer;
}

.menu-btn i {
    font-size: 24px;
    color: var(--gray-color);
}

.home-btn img.logo {
    height: 32px;
    margin-right: 8px;
}

.home-btn span {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
}

.header-right .btn {
    margin-left: 8px;
    border: none;
    background: none;
    color: var(--gray-color);
    display: flex;
    align-items: center;
}

.header-right .btn i {
    font-size: 20px;
    margin-right: 4px;
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--accent-color);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* 主体布局 */
.main-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* 侧边导航栏 */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    overflow-y: auto;
    transition: width 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    padding: 0 16px 16px;
}

.toggle-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--hover-color);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .toggle-sidebar-btn i {
    transform: rotate(180deg);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--gray-color);
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link i {
    font-size: 20px;
    margin-right: 12px;
    min-width: 20px;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: var(--hover-color);
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background-color: var(--hover-color);
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: var(--light-color);
}

/* 标签栏 */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.nav-tabs .nav-link {
    color: var(--gray-color);
    border: none;
    padding: 8px 16px;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background-color: transparent;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 8px 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 4px;
}

#projectsTable tr.selected-project {
    background-color: rgba(13, 110, 253, 0.1);
}

.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    padding-left: 36px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.filters {
    display: flex;
    gap: 16px;
}

.filter-item {
    display: flex;
    align-items: center;
}

.filter-label {
    margin-right: 8px;
    font-size: 14px;
    color: var(--gray-color);
    white-space: nowrap;
}

.filters .form-select {
    width: auto;
    border-radius: 4px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* 表格样式 */
.table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: var(--gray-color);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    vertical-align: middle;
}

.table .status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #e6f4ea;
    color: var(--secondary-color);
}

.status-completed {
    background-color: #e8f0fe;
    color: var(--primary-color);
}

.status-paused {
    background-color: #fce8e6;
    color: var(--accent-color);
}

.status-online {
    background-color: #e6f4ea;
    color: var(--secondary-color);
}

.status-offline {
    background-color: #f1f3f4;
    color: var(--gray-color);
}

.status-passed {
    background-color: #e6f4ea;
    color: var(--secondary-color);
}

.status-failed {
    background-color: #fce8e6;
    color: var(--accent-color);
}

.status-partial {
    background-color: #fef7e0;
    color: #f9ab00;
}

/* 模板网格 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.template-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.template-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.template-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.template-card p {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 8px;
}

.template-card .category {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    background-color: var(--hover-color);
    color: var(--primary-color);
    border-radius: 12px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .nav-link i {
        margin-right: 0;
    }
    
    .header-right span {
        display: none;
    }
}

@media (max-width: 768px) {
    .filters, .action-buttons {
        display: none;
    }
    
    .search-container {
        width: 100%;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}